package com.fanketly.funacg2.ui.viewmodels

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.fanketly.funacg2.R
import com.fanketly.funacg2.data.network.RetrofitNetwork
import com.fanketly.funacg2.utils.getAppString
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class SettingViewModel @Inject constructor(
    private val retrofitNetwork: RetrofitNetwork,
    private val globalStates: GlobalStates,
) :
    ViewModel() {
    fun getBestServer() {
        viewModelScope.launch {
            globalStates.showLoading()
            with(retrofitNetwork) {
                getBestServer {
                   globalStates.setStateClose()
                }
            }
        }
    }
}